package com.sx.zongzhi.presenter;

import com.sx.zongzhi.MyApplication;
import com.sx.zongzhi.bean.AppealProcessBean;
import com.sx.zongzhi.modle.ApiManager;
import com.sx.zongzhi.net.BaseCallBack;
import com.sx.zongzhi.net.BaseResult;
import com.sx.zongzhi.view.IAppealProcessView;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by XZY on 2017/11/30.
 *获取诉求服务处理记录
 */
public class AppealProcessPest {

    private IAppealProcessView processView;

    public AppealProcessPest(IAppealProcessView processView) {
        this.processView=processView;
    }


    /**
     *
     * @param appealId 诉求事件id
     */
    public void getAppealProList(String appealId){
        Map<String,Object> map=new HashMap<>();
        map.put("sid", MyApplication.sid);
        map.put("appealId", appealId);
        new ApiManager().getAppealProList(map, new BaseCallBack<BaseResult<List<AppealProcessBean>>>() {
            @Override
            public void onSuccess(BaseResult<List<AppealProcessBean>> response) {
                processView.getAppealProList(response.getData());
            }
            @Override
            public void onFailures(String message) {
                processView.showError(message);
            }
        });
    }

}
